package com.ruoyi.web.controller.h5.contruction;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.ConstructionProjectService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/h5/construction")
public class ConstructionController {

    @Resource
    private ConstructionProjectService constructionProjectService;

    /**
     * 根据用户id查询施工项目详情
     */
    @GetMapping("/details")
    public AjaxResult getConstructionDetailsByUserId(@RequestParam("userId") Long userId) {

        return AjaxResult.success(constructionProjectService.getProjectByH5UserId(userId));
    }
}
